package com.project.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.project.ds.MemberMapper;
import com.project.entity.user.Member;
import com.project.service.IMemberService;

@Service
@Transactional
public class MemberServiceImpl implements IMemberService{
	
	@Autowired
	private MemberMapper memberMapper;

	@Override
	public Long save(Member member) {
		memberMapper.insert(member);
		return member.getId();
	}

	@Override
	public Member getByUserId(Long userId) {
		Member member = new Member();
		member.setUserId(userId);
		return memberMapper.find(member);
	}

	@Override
	public void update(Member member) {
		memberMapper.updateSelective(member);
	}
}
